﻿using System;
using System.Windows.Forms;
using WebMoney.WMSignerFX.KeysExtractor.Properties;

namespace WebMoney.WMSignerFX.KeysExtractor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(
                delegate(object sender, System.Threading.ThreadExceptionEventArgs e)
                    {
                        string message = (string.IsNullOrEmpty(e.Exception.Message) ? string.Empty : string.Format(null, " ({0})", e.Exception.Message));

                        MessageBox.Show(string.Format(null, "{0} {1}", Resources.UnexpectedError, message), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Application.Exit();
                    });

            Application.Run(new MainForm());
        }
    }
}